#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__

#include "cocos2d.h"
#include "cc2dv2.h"

class PlaneBullet;

class HelloWorld : public cocos2d::CCLayer
{
public:
	~HelloWorld();
public:
	// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
	virtual bool init();

	// there's no 'id' in cpp, so we recommend returning the class instance pointer
	static cocos2d::CCScene* scene();

	// a selector callback
	void menuCloseCallback(CCObject* pSender);

	// implement the "static node()" method manually
	CREATE_FUNC(HelloWorld);
	void ccTouchesBegan(cocos2d::CCSet *pTouches, cocos2d::CCEvent *pEvent);
	void ccTouchesMoved(cocos2d::CCSet *pTouches, cocos2d::CCEvent *pEvent);
private:
	void		beginFire(float d);
	void		unBindBtnCB(cocos2d::CCObject* p);
	int		hitCheck(const convex_polygon_t* p);
	void		drawDebug(const convex_polygon_t* p1, const convex_polygon_t* p2);
	void		autoMachine(pos_t* out);
private:
	cocos2d:: CCPoint _lastPos;
	struct CSB::BindProto::bind_t*		_myBind;
	unsigned int			_hit;
};

#endif // __HELLOWORLD_SCENE_H__
